﻿using System.Threading.Tasks;
using Abp.Domain.Repositories;
using Abp.EntityHistory;
using KelonProud.Administration.Logs.Domain;

namespace KelonProud.Administration.Logs
{
    public class EntityHistoryStore:IEntityHistoryStore
    {
        private readonly IRepository<KelonEntityChangeSet, long> _changeSetRepository;

        public EntityHistoryStore(IRepository<KelonEntityChangeSet, long> changeSetRepository)
        {
            _changeSetRepository = changeSetRepository;
        }

        public Task SaveAsync(Abp.EntityHistory.EntityChangeSet entityChangeSet)
        {
            return _changeSetRepository.InsertAsync(KelonEntityChangeSet.ToHonkEntityChangeSet(entityChangeSet));
        }
    }
}
